import { HashRouter, Routes, Route, Navigate } from 'react-router-dom'
import Login from '../src/pages/LoginPage'
import Home from '../src/pages/HomePage'
import React from 'react'
import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
function App() {
  const System = React.lazy(() => import('../src/pages/SystemPage'))
  const UserMange = React.lazy(() => import('../src/pages/store/UserMange'))
  const RoleMange = React.lazy(() => import('../src/pages/store/RoleMange'))
  const MenuMange = React.lazy(() => import('../src/pages/store/MenuMange'))
  const DitctionaryMange = React.lazy(() => import('../src/pages/store/DitctionaryMange'))
  return (
    <React.Suspense fallback={<div>加载中...</div>}>
      <ConfigProvider locale={zhCN}>
        <HashRouter>
          <Routes>
            <Route path='/' element={<Navigate to="/login" />} />
            <Route path='login' element={<Login />} />
            <Route path='home' element={<Home />}  >
              {/* <Route path='system' element={<System />}> */}
              <Route path='system/user' element={<UserMange />} />
              <Route path='system/role' element={<RoleMange />} />
              <Route path='system/menu' element={<MenuMange />} />
              <Route path='system/dict' element={<DitctionaryMange />} />
              {/* </Route> */}
            </Route>

          </Routes>
        </HashRouter>
      </ConfigProvider>
    </React.Suspense>
  )
}

export default App
